home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************************/
- /* NextSubAndPosit */
- /* */
- /* This procedure returns the first available subscript int the windTbl, and the */
- /* next position which should be used for a new window. */
- /* */
- /* Note. This routine will not look at positions 0 or 1 in windTbl, since they */
- /* are reserved for the main window and a help window. */
- /************************************************************************************/
-
- #include "MyHeaders.h"
-
- short NextSubAndPosit (Point * nextPosit)
- {
- short NSRetCode = 0;
-
- windSub = 0;
- for (j=2; j<windMax; j++) /* find the first empty pointer in windTbl */
- {
- if (windTbl[j].windPtr == 0)
- {
- windSub = j;
- break;
- }
- }
- if (windSub == 0)
- { /* if no empty pointer was found */
- NSRetCode = 1; /* set a bad return code */
- goto ENDING; /* and get out */
- }
-
-
- (*nextPosit).v +=20; /* incr vertical position */
- if ((*nextPosit).v > (screenBits.bounds.bottom - 225)) /* if too far down */
- (*nextPosit).v = 40; /* reset near top */
-
- (*nextPosit).h +=10; /* incr horizontal position */
- if ((*nextPosit).h > (screenBits.bounds.right - 345)) /* if too far right */
- (*nextPosit).h = 10; /* reset near left */
-
-
- ENDING:
- return NSRetCode;
- }
-